package com.tskj.mh.savefoodorder.controller;

import com.alibaba.fastjson.JSONObject;
import com.tskj.mh.savefoodorder.aop.annotation.SystemControllerLog;
import com.tskj.mh.savefoodorder.service.SaveFoodOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
public class SaveFoodOrderController {

    @Autowired
    private SaveFoodOrderService saveFoodOrderService;

    @SystemControllerLog(MODULENAME = "订餐")
    @PostMapping("saveOrder")
    @ResponseBody
    public JSONObject saveOrder(@RequestParam String token, @RequestBody JSONObject json) {
        return saveFoodOrderService.saveOrder(saveFoodOrderService.getAdUserName(token), json);
    }

}
